/* Code for Tables and Figures in Manuscript 'The immigrant presence in collaborative structures of urban politics' */

/*Table 1*/
tab _17p
tab _17p if country=="DE"
tab _17p if country=="FR"
tab _17p if ImmigrantOrg==0
tab _17p if country=="DE" & ImmigrantOrg==0
tab _17p if country=="FR" & ImmigrantOrg==0

/*Figure 1*/
tab _17c
tab _17e
tab _17p
tab _17r
tab _17t

/*Table 2*/
eststo: quietly ologit _17p _17o i._country if ImmigrantOrg==0, or
eststo: quietly ologit _17p _17o _11all _16divatt i._country if ImmigrantOrg==0, or
eststo: quietly ologit _17p _17o _11all _16divatt if _country==1 & ImmigrantOrg==0, or
eststo: quietly ologit _17p _17o _11all _16divatt if _country==2 & ImmigrantOrg==0, or
esttab using EJPRTable2_.rtf`, se pr2
`
eststo clear 

/*Table 3 - Use City-level dataset*/
eststo: quietly reg CoopImm logpop foreignborn CoopGovern PosAttTowDiv, robust
eststo: quietly reg CoopImm logpop foreignborn CoopGovern CoopIntegr PosAttTowDiv, robust
eststo: quietly reg CoopImm logpop foreignborn CoopGovern CoopIntegr PosAttTowDiv leftwingmayor, robust
eststo: quietly reg CoopImm logpop foreignborn CoopGovern CoopIntegr PosAttTowDiv leftwingpower, robust
eststo: quietly reg CoopImm logpop foreignborn CoopGovern CoopIntegr PosAttTowDiv prcmigcouncil, robust
esttab using EJPRTable3.rtf, se ar2

eststo clear 


tab _11all statuscode, column
tab _11all statuscode if country==1, column
tab _11all statuscode if country==2, column

/*Figure 2*/

tab _17p statuscode if _country==1 & ImmigrantOrg==0, column
tab _17p statuscode if _country==2 & ImmigrantOrg==0, column

/*Figure 3*/



/*Table 4*/

eststo: quietly ologit _17p _17o _11all _16divatt i._country i.statuscode_01 if ImmigrantOrg==0, or
eststo: quietly ologit _17p _17o _11all _16divatt i.statuscode_01 if _country==1 & ImmigrantOrg==0, or
eststo: quietly ologit _17p _17o _11all _16divatt i.statuscode_01 if _country==2 & ImmigrantOrg==0, or
esttab using EJPRTable4_.rtf`, se pr2

